﻿using CSTK.Core.TopShelf_Quartz.Common;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace CSTK.Core.TopShelf_Quartz.Job
{
    [DisallowConcurrentExecution]//确保上次任务执行完成后 再执行下一次任务
    public class ServiceXFDXReaderSynJob : IJob
    {
        public ServiceXFDXReaderSynJob()
        {
        }
        public Task Execute(IJobExecutionContext context)
        {
            var dataMap = context.JobDetail.JobDataMap;
            string strConn=dataMap.GetString("sqlconnection");
            string ip=dataMap.GetString("ip");
            if (string.IsNullOrEmpty(strConn) && string.IsNullOrEmpty(ip)) {
                Console.WriteLine("获取配置信息失败");
                return null;
            }
            return Task.Factory.StartNew(_ =>
            {
                
            },
    null,
    CancellationToken.None,
    TaskCreationOptions.LongRunning,
    TaskScheduler.Default);
        }
    }
}
